<div class="post">
	<h2><%= @post[:title]%></h2>
	<span class="post_date"><%= @post[:create_at].strftime("%m/%d/%Y") if @post[:create_at] != nil %></span>
	<ul class="post_menu">
		<li><%= link_to_remote 'Back',
		:loading => "new Element.hide('content')",
		:complete => "new Effect.Appear('content',{queue: 'end'})",
		:update => 'content',
		:url => { :action => 'list' } %></li>
	</ul>
	<div class="post_body">
		<%= @post[:body].gsub(/\[:[a-zA-Z]+\]/,"") %>
	</div>
	<div id="comments">
		<% 
		i = 0;
		for comment in @comments.sort{ |x,y|
		y.comment_on <=> x.comment_on
		} 
		i = i + 1 %>
		<div class="comment<%= ' right' if i % 2 == 0 %>">
			<%= mail_to comment.email, comment.author, :class => 'comment_author',:encode => 'utf-8' %><br />
			<span class="comment_date"><%= comment.comment_on.strftime("%T - %D") if comment.comment_on != nil %></span><br />
			<p>
			<%=h comment.content %>
			</p>
		</div>
		<%end%>
	</div>
	<%= form_remote_tag :url => {:action => 'comment', :id => @post},
	:update => 'comments',
	:position => 'top',
	:success => "new Element.scrollTo('comments')"%>
	<%= render :partial => 'comment_form' %>
	<%= submit_tag "Comment", :id => 'comment_send'%>
	<%= end_form_tag %>
</div>

